package com.ashbur.rookie.admin.service.impl;

import com.ashbur.rookie.admin.repository.FriendLinkRepository;
import com.ashbur.rookie.admin.service.FriendLinkService;
import com.ashbur.rookie.common.enums.YesOrNo;
import com.ashbur.rookie.pojo.mo.FriendLinkMO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FriendLinkServiceImpl implements FriendLinkService {

    @Resource
    private FriendLinkRepository friendLinkRepository;

    @Override
    public void saveOrUpdateFriendLink(FriendLinkMO friendLinkMO) {
        friendLinkRepository.save(friendLinkMO);
    }
    @Override
    public List<FriendLinkMO> queryFriendLinkList() {
        return friendLinkRepository.findAll();
    }

    @Override
    public void deleteFriendLink(String linkId) {
        friendLinkRepository.deleteById(linkId);
    }

    @Override
    public List<FriendLinkMO> queryPortalFriendLinkList() {
        return friendLinkRepository.getAllByIsDelete(YesOrNo.NO.type);
    }




}

